package com.nuyoah.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nuyoah.entity.ActivityUser;
import com.nuyoah.mapper.ActivityUserMapper;
import com.nuyoah.service.ActivityUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xiaoming
 * @since 2024-03-26
 */
@Service
public class ActivityUserServiceImpl extends ServiceImpl<ActivityUserMapper, ActivityUser> implements ActivityUserService {

    @Autowired
    private ActivityUserMapper activityUserMapper;

    @Override
    // ActivityUserService.java
    public ActivityUser getByActivityId(Long activityId) {
        // 使用 MyBatis-Plus 的查询构建器
        QueryWrapper<ActivityUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("activity_id", activityId);
        return activityUserMapper.selectOne(queryWrapper);
    }


}
